package test3_7;
import java.util.Scanner;
public class homework3_10 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //定义参数表示输入的所得额
        System.out.print("请输入工资：");
        double salary = sc.nextDouble();
        double taxSalary = 0;
        taxSalary = salary-3500;
        double tax = 0;
        double totalSalary = 0;
        if(taxSalary<=0){
            System.out.println("无需交税");
        }else if(taxSalary<=1500){
            tax = taxSalary*0.03;
            totalSalary = salary - tax;
            System.out.println("个人所得税为"+tax+"元"+" "+"税后工资为"+ totalSalary +"元");
        }else if(salary>1500 && salary<=4500){
            tax = taxSalary*0.1-105;
            totalSalary = salary - tax;
            System.out.println("个人所得税为"+tax+"元"+" "+"税后工资为"+ totalSalary +"元");
        }else if(salary>4500 && salary<=9000){
            tax = taxSalary*0.2-555;
            totalSalary = salary - tax;
            System.out.println("个人所得税为"+tax+"元"+" "+"税后工资为"+ totalSalary +"元");
        }else if(salary>9000 && salary<=35000){
            tax = taxSalary*0.25-1005;
            totalSalary = salary - tax;
            System.out.println("个人所得税为"+tax+"元"+" "+"税后工资为"+ totalSalary +"元");
        }else if(salary>35000 && salary<=55000){
            tax = taxSalary*0.3-2755;
            totalSalary = salary - tax;
            System.out.println("个人所得税为"+tax+"元"+" "+"税后工资为"+ totalSalary +"元");
        }else if(salary>55000 && salary<=80000){
            tax = taxSalary*0.35-5505;
            totalSalary = salary - tax;
            System.out.println("个人所得税为"+tax+"元"+" "+"税后工资为"+ totalSalary +"元");
        }else if(salary>80000){
            tax = taxSalary*0.45-13505;
            totalSalary = salary - tax;
            System.out.println("个人所得税为"+tax+"元"+" "+"税后工资为"+ totalSalary +"元");
        }
    }
}